Use Debian packaged IPhythonSphinx extensions
authorDebian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Sat, 2 Mar 2019 14:59:35 +0000 (14:59 +0000)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Sat, 2 Mar 2019 14:59:35 +0000 (14:59 +0000)
Last-Update: Wed, 13 Feb 2019 08:43:05 +0100

Also drop matplotlib.sphinxext.only_directives which fail with
python3-matplotlib and are not used

Gbp-Pq: Name deb_use_internal_ipythonsphinx_extensions

docs/source/conf.py

index 969eb7d3da5e2e4e83098420cb55894df38634b8..91f4c7b1aa26e5b2a4ac6700b1826982f848c812 100644 (file)
@@ -36,14 +36,29 @@ extensions = ['sphinx.ext.autodoc',
               'sphinx.ext.autosummary',
               'sphinx.ext.inheritance_diagram',
               'matplotlib.sphinxext.plot_directive',
-              'matplotlib.sphinxext.only_directives',
-              'IPython.sphinxext.ipython_console_highlighting',
-              'IPython.sphinxext.ipython_directive',
+              #'matplotlib.sphinxext.only_directives',
+              #'IPython.sphinxext.ipython_console_highlighting',
+              #'IPython.sphinxext.ipython_directive',
               'github',  # for GitHub links,
               'numpydoc',  # numpydoc or napoleon, but not both
               # 'sphinx.ext.napoleon'
               ]
 
+try:
+    import IPython.sphinxext.ipython_console_highlighting as _
+    import IPython.sphinxext.ipython_directive as _
+    extensions += [
+        'IPython.sphinxext.ipython_console_highlighting',
+        'IPython.sphinxext.ipython_directive'
+        ]
+except:
+    # If systems have older IPython, just use shipped copies
+    extensions += [
+        'ipython_console_highlighting',
+        'ipython_directive'
+        ]
+
+
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
 
@@ -332,4 +347,4 @@ import numpy as np
 import scipy.stats as stats
 import matplotlib.pyplot as plt
 import pandas as pd
-"""
\ No newline at end of file
+"""